home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Tech Arsenal 1
/
Tech Arsenal (Arsenal Computer).ISO
/
tek-02
/
oop_tp55.zip
/
LIST3_2.PAS
< prev
next >
Wrap
Pascal/Delphi Source File
|
1990-03-08
|
1KB
|
63 lines
program Listing 3_2;
uses Tags, Crt;
var
LT100,
FT100 : Analog;
PSL100 : LoSwitch;
PSH100 : HiSwitch;
EY100 : Pump;
time : integer;
begin
LT100.Init( 'LT100', 512, 50, 250 );
FT100.Init( 'FT100', 2048, 0, 10000 );
PSL100.Init( 'PSL100', 60, HtToPSI(LT100.GetValue) );
PSH100.Init( 'PSH100', 75, HtToPSI(LT100.GetValue) );
EY100.Init( 'EY100', off, 8000);
time := 0;
repeat
Inc( time ); { increment the time }
LT100.PutValue( LT100.GetValue - FlowToDeltaHt(FT100.GetValue) );
PSL100.PutReading( HtToPSI(LT100.GetValue) );
PSH100.PutReading( HtToPSI(LT100.GetValue) );
if Quiet.IsOff then
writeln( f, 'Level is ', LT100.GetValue:2:2,
' ft at minute ', time );
if PSL100.GetStatus = on then
EY100.PutStatus( ON );
if PSH100.GetStatus = on then
EY100.PutStatus( OFF );
LT100.PutValue( LT100.GetValue + FlowToDeltaHt(EY100.Flow ));
{ if the next line of code is not commented out, you'll see only
reports for even values of time; otherwise, reports for each
time value will be printed. }
{ if (time mod 2 = 0) then Quiet.On else Quiet.Off; }
until KeyPressed;
Quiet.On;
end.
{Listing 3-2 }